﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<t_205_verk_hopur_12.Models.ChannelSearchViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Stöðvarleit
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MenuBar" runat="server">
    <% Html.RenderPartial("MenuBar"); %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Stöðvarleit</h2>
    
    <table id="search">
        <tr>
            <th>
                <%= Html.ActionLink("Nafn", "Search", "Channel", new { query = Request.QueryString["query"], sort = "name", by = (Request.QueryString["by"] == "desc" ? "asc" : "desc") }, null) %>
            </th>
            <th>
                Lýsing
            </th>
            <th>
                <%= Html.ActionLink("Vinsældir", "Search", "Channel", new { query = Request.QueryString["query"], sort = "popular", by = (Request.QueryString["by"] == "desc" ? "asc" : "desc") }, null) %>
            </th>
            <th>
                <%= Html.ActionLink("Flokkur", "Search", "Channel", new { query = Request.QueryString["query"], sort = "category", by = (Request.QueryString["by"] == "desc" ? "asc" : "desc") }, null) %>
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink(item.Channel.Name, "Index", "Channel", new { id = item.Channel.ID }, null)%>
            </td>
            <td>
                <%= Html.Encode(item.Channel.Description) %>
            </td>
            <td class="rating">
                <%= Html.Encode(item.Channel.Rating) %>
            </td>
            <td>
                <%= Html.Encode(item.Category.Name) %>
            </td>
        </tr>
    
    <% } %>

    </table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LogoText" runat="server">
</asp:Content>

